package com.ccrfid.rmc6.service.mattress;

import com.ccrfid.rmc6.appconfig.exception.pojo.AppException;
import com.ccrfid.rmc6.entity.mattress.BedEntity;
import com.ccrfid.rmc6.entity.mattress.BedHistoryEntity;
import com.ccrfid.rmc6.entity.mattress.MattressStateEntity;
import com.ccrfid.rmc6.pojo.dto.mattress.BedLayoutDto;
import com.ccrfid.rmc6.repository.search.SearchCriteria;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.sql.Timestamp;
import java.util.List;
import java.util.Set;

public interface BedService {
    //获取床位布局
    public BedLayoutDto getBedLayout();

    //获取床位信息
    List<BedEntity> getAllBeds();

    //新增床位信息
    BedEntity createBed(BedEntity bedEntity) throws AppException;

    //修改床位绑定的床垫信息
    BedEntity updateBedMattress(String bedSn, String mattressSn) throws AppException;

    //删除床位信息
    Boolean deleteBed(String bedSn) throws AppException;

    //获取可用床垫信息
    Set<String> getAvailableMattresses();

    //人员入住床位
    BedEntity bedCheckIn(String bedSn, BedEntity bedEntity) throws AppException;

    //人员退出床位
    Boolean bedCheckOut(String bedSn) throws AppException;

    //查询某个床位人员的入住时间
    BedHistoryEntity getBedCheckInTime(String bedSn);

    //获取床垫历史数据
    List<MattressStateEntity> getMattressStateHistory(String mattressSn, Timestamp startTime, Timestamp stopTime);

    //分页获取床垫历史数据
    Page<MattressStateEntity> getMattressStateHistoryPage(SearchCriteria criteria, Pageable pageable);
}
